﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MyCommunity.Models.SearchViewModel<UserViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Index</h2>

<p>
    <%: Html.ActionLink("Create New", "Create") %>
</p>



<script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(function () {
        $("#searchString").autocomplete({ 
            source:
            '<%: Url.Action("AutoComplete")%>'
        });
    });
</script>
   
<p />

<p>
     <% using (Html.BeginForm()) {%>

     Suche: <%: Html.TextBox("searchString")%>
     <input type="submit" value="Suche" />


     <% } %>

</p>

<table>
    <tr>
        <th>
            Firstname
        </th>
        <th>
            Lastname
        </th>
        <th>
            Mail
        </th>
        <th>
            Birthday
        </th>
        <th>
            IsActive
        </th>
        <th>
            IsAdmin
        </th>
        <th></th>
    </tr>

<% foreach (var item in Model.users) { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.Firstname) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Lastname) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Mail) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Birthday) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.IsActive) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.IsAdmin) %>
        </td>
        <td>
            <%: Html.ActionLink("Edit", "Edit", new { id = item.Id })%> |
            <%: Html.ActionLink("Details", "Details", new { id=item.Id }) %> 
            
        </td>
    </tr>
<% } %>

</table>

</asp:Content>
